﻿@model UscSunShine.Mvc.Models.RegisterViewModel
@{
    ViewBag.Title = "创建用户";
}
<h2>创建用户</h2>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    //创建防伪标记
    <div class="form-horizontal">
        <h4>创建用户</h4>
        <hr />
        <h4></h4>
        @Html.ValidationSummary("", new { @class = "text-error" })
        <div class="form-group">
            @Html.LabelFor(m => m.Username, new { @class = "col-md-2 control-label" })
            <div class="col-md-10">
                @Html.TextBoxFor(m => m.Username, new { @class = "form-control" })
            </div>
        </div>
        <div class=" form-group">
            @Html.LabelFor(model => model.Email, new { @class = "col-md-2 control-label" })
            <div class=" col-md-10">
                @Html.TextBoxFor(model => model.Email, new { @class = "form-control" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.Password, new { @class = "col-md-2 control-label" })
            <div class=" col-md-10">
                @Html.PasswordFor(model => model.Password, new { @class = "form-control" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.ConfirmPassword, new { @class = "col-md-2 control-label" })
            <div class=" col-md-10">
                @Html.PasswordFor(model => model.ConfirmPassword, new { @class = "form-control" })
            </div>
        </div>
        <div class=" form-group">
            <label class=" col-md-2 control-label">
                编辑用户角色
            </label>
            <div class=" col-md-10">
                @foreach (var item in (SelectList)ViewBag.RoleId)
            {
                <input type="checkbox" name="SelectedRoles" value="@item.Value" class="checkbox-inline" />
                @Html.Label(item.Text, new { @class = "control-label" })
            }
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="新建用户" class="btn btn-primary" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("返回用户列表", "Index")
</div>
@section Scripts{
    @Scripts.Render("~/bundles/jqueryval")
}
